<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <title>志愿一点通</title>
    <link href="${ctxStatic}/bootstrap/3.3.2/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="${ctxStatic}/app/css/master.css">
    <style>
        #scoreModal .modal-dialog{
            margin-top: 40%;
            margin-left: 20%;
            width: 60%;
        }
        .bold{
            font-weight: bold;
        }
        .nodata{
            height: 30px;
            font-size: 16px;
            margin-top: 50%;
            text-align: center;
        }
    </style>
</head>
<body>
<nav class="topbar bluebg">
    <a class="icon-arrow icon-return" href="${wechat}/index"></a>
    <h1>${volunteer.name}</h1>
    <a class="nav-right" href="javascript:;" onclick="favorite('volunteer',$('#vid').val(),'','','');">收藏</a>
</nav>
<input type="hidden" id="vtype" name="vtype" value="${param.vtype}"/>
<input type="hidden" id="vid" name="vid" value="${volunteer.volunteerCode}"/>
<div class="wrap">
    <div class="sortebox">
        <ul class="clearfix">
            <li id="opt_tab1">地区</li>
            <li id="opt_tab2">专业</li>
            <li id="opt_tab3">类别</li>
            <li id="opt_tab4">筛选</li>
        </ul>
    </div>

    <div class="schoollist">
        <c:choose>
            <c:when test="${not empty volunteerSchoolList}">
                <ul>
                    <c:forEach items="${volunteerSchoolList}" var="volunteerSchool" varStatus="status">
                        <li>
                            <a href="${wechat}/schoolDetail?schoolCode=${volunteerSchool.school.schoolCode}&schoolCodeSn=${volunteerSchool.school.schoolCodeSn}&lqRate=${volunteerSchool.lqRate*100}">
                                <div class="schoolbox clearfix">
                                    <div class="school-logo"><img src="${volunteerSchool.school.schoolLogo}"></div>
                                    <div class="school-info">
                                        <div class="school">
                                            <span class="school-name bold">${volunteerSchool.school.schoolName}</span>
                                            <span class="enroll-rate frt bold">录取率：<i class="red"><b><fmt:formatNumber value="${volunteerSchool.lqRate*100}" maxFractionDigits="1"/></b>%</i></span>
                                        </div>
                                        <div class="school-attr">
                                            <span class="school-rank">
                                                <c:choose>
                                                    <c:when test="${userMain.kmType eq '1'}">No.${volunteerSchool.school.schoolWenRank}</c:when>
                                                    <c:when test="${userMain.kmType eq '5'}">No.${volunteerSchool.school.schoolRanking}</c:when>
                                                    <c:otherwise>No.${volunteerSchool.school.schoolRanking}</c:otherwise>
                                                </c:choose>
                                            </span>
                                            <span class="school-rank"></span>
                                            <span class="enroll-line frt bold">${lqYear}年预测投档线：<i class="enroll-num">${volunteerSchool.school.remarks}</i></span>
                                        </div>
                                        <div class="school-tab">
                                            <span class="label label-info">${volunteerSchool.school.provinceName}</span>
                                            <c:if test="${not empty volunteerSchool.school.cityName}">
                                                <span class="label label-info">${volunteerSchool.school.cityName}</span>
                                            </c:if>
                                            <c:if test="${volunteerSchool.school.flag211 eq '1'}">
                                               <span class="label label-info">211</span>
                                            </c:if>
                                            <c:if test="${volunteerSchool.school.flag985 eq '1'}">
                                                <span class="label label-info">985</span>
                                            </c:if>
                                            <c:if test="${volunteerSchool.school.flagYan eq '1'}">
                                                <span class="label label-info">研</span>
                                            </c:if>
                                            <span class="label label-info">${fns:getDictLabel(volunteerSchool.school.schoolType,'school_type','综合')}</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="scorelist">
                                    <div class="row score-head">
                                        <div class="col-xs-2">年份</div>
                                        <div class="col-xs-2 ebg">投档线</div>
                                        <div class="col-xs-2 ebg">录取平均分</div>
                                        <div class="col-xs-2 ebg">线差</div>
                                        <div class="col-xs-2">最低等效分</div>
                                        <div class="col-xs-2">平均等效分</div>
                                    </div>
                                    <c:forEach items="${volunteerSchool.school.lqSchoolList}" var="lqSchool">
                                        <div class="row score">
                                            <div class="col-xs-2">${lqSchool.lqYear}</div>
                                            <div class="col-xs-2">${lqSchool.tdxScore}</div>
                                            <div class="col-xs-2">
                                                <fmt:formatNumber value="${lqSchool.lqAvrgScore}" maxFractionDigits="1"/>
                                            </div>
                                            <div class="col-xs-2">${lqSchool.diffScore}</div>
                                            <div class="col-xs-2">${lqSchool.twfMinScore}</div>
                                            <div class="col-xs-2">
                                                <fmt:formatNumber value="${lqSchool.twfAvrgScore}" maxFractionDigits="1"/>
                                            </div>
                                        </div>
                                    </c:forEach>
                                </div>
                                <c:choose>
                                    <c:when test="${volunteer.vtype eq 'steady'}"><i class="icon-tag icon-wen"></i></c:when>
                                    <c:when test="${volunteer.vtype eq 'safely'}"><i class="icon-tag icon-bao"></i></c:when>
                                    <c:when test="${volunteer.vtype eq 'danger'}"><i class="icon-tag icon-chong"></i></c:when>
                                </c:choose>

                                <i class="icon-num icon-no${status.index+1}"></i>
                            </a>
                        </li>
                    </c:forEach>
                </ul>
            </c:when>
            <c:otherwise><div class="nodata">很抱歉，暂未找到相关内容</div></c:otherwise>
        </c:choose>
    </div>
</div>

<div class="shade" id="shade"></div>
<!--地区-->
<div class="classbox" id="citybox">
    <div class="typelist">
        <ul data-checks="radio">
            <li class="cur" rel="">不限</li>
            <c:forEach items="${fns:getProvinceList()}" var="area">
                <li rel="${area.code}">${area.name}</li>
            </c:forEach>
        </ul>
    </div>
    <div class="choosebtn">
        <button class="optbtn" id="cityboxBtn">确定</button>
    </div>
</div>

<!--专业-->
<div class="classbox" id="majorbox">
    <div class="typelist" id="courselist" >
        <ul data-checks="radio">
            <li class="cur" rel="">不限</li>
            <c:forEach items="${parentMajorList}" var="item">
                <li data-type="option" rel="${item.majorParentCode}">${item.majorParentName}</li>
            </c:forEach>
        </ul>
    </div>
    <!--二级-->
    <div class="subtype subtype_a" id="sublist_a" >
        <ul data-checks="radio">
        </ul>
    </div>
    <!--三级-->
    <div class="subtype subtype_b" id="sublist_b" style="display: none;">
        <ul data-checks="radio">
            <li>医学影像技术</li>
            <li>医学实验技术</li>
            <li>医学检验技术</li>
            <li>眼视光学</li>
            <li>口腔医学技术</li>
            <li>康复治疗学</li>
            <li>卫生检验与检疫</li>
            <li>听力与言语康复学</li>
        </ul>
    </div>

    <div class="choosebtn">
        <button class="optbtn" id="majorboxBtn">确定</button>
    </div>
</div>

<!--类型-->
<div class="classbox" id="typebox">
    <div class="typelist">
        <ul data-checks="radio">
            <li class="cur" rel="">不限</li>
            <c:forEach items="${fns:getDictList('school_type')}" var="item">
                <li rel="${item.value}">${item.label}</li>
            </c:forEach>
        </ul>
    </div>
    <div class="choosebtn">
        <button class="optbtn" id="typeboxBtn">确定</button>
    </div>
</div>

<!--筛选-->
<div class="classbox" id="synbox">
    <div class="typelist">
        <ul class="opttab" data-checks="radio">
            <li id="syn_tab01" style="display: none;">地区</li>
            <li class="cur" id="syn_tab02">学校标签</li>
            <li id="syn_tab03" style="display: none;">学校类别</li>
        </ul>
    </div>
    <div class="tablist" id="tablist_a" style="display: none;">
        <ul data-checks="radio">
            <li class="cur">不限</li>
            <li>北京市</li>
            <li>上海市</li>
            <li>广东省</li>
            <li>江苏省</li>
            <li>湖南省</li>
            <li>浙江省</li>
            <li>山东省</li>
            <li>安徽省</li>
            <li>湖北省</li>
        </ul>
    </div>
    <div class="tablist sch-taglist" id="tablist_b">
        <ul data-checks="checkbox">
            <li rel="211">211</li>
            <li rel="985">985</li>
        </ul>
    </div>
    <div class="tablist" id="tablist_c" style="display: none;">
        <ul data-checks="radio">
            <li class="cur">不限</li>
            <li>财经类</li>
            <li>军事类</li>
            <li >理工类</li>
            <li>林业类</li>
            <li>民族类</li>
            <li>农林类</li>
            <li>商学院</li>
            <li>师范类</li>
            <li>体育类</li>
        </ul>
    </div>
    <div class="choosebtn">
        <button class="optbtn" id="synboxBtn">确定</button>
    </div>
</div>
<script src="${ctxStatic}/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/bootstrap/3.3.2/js/bootstrap.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/app/js/main.js" type="text/javascript"></script>
<script>
    $(document).ready(function(){
        //初始化查询条件
        var areaCode = "${params.schoolArea}";
        if(areaCode){
            $("#citybox").find(".typelist ul").find("li").removeClass("cur");
            $("#citybox").find(".typelist ul").find("li[rel='"+areaCode+"']").addClass("cur");
            $("#opt_tab1").text($("#citybox").find(".typelist ul").find("li[rel='"+areaCode+"']").text());
        }

        var majorParentCode = "${params.majorParentCode}";
        if(majorParentCode){
            $("#majorbox").find(".typelist ul").find("li").removeClass("cur");
            $("#majorbox").find(".typelist ul").find("li[rel='"+majorParentCode+"']").addClass("cur");
            $("#opt_tab2").text($("#majorbox").find(".typelist ul").find("li[rel='"+majorParentCode+"']").text());
        }

        var schoolType = "${params.schoolType}";
        if(schoolType){
            $("#typebox").find(".typelist ul").find("li").removeClass("cur");
            $("#typebox").find(".typelist ul").find("li[rel='"+schoolType+"']").addClass("cur");
            $("#opt_tab3").text($("#typebox").find(".typelist ul").find("li[rel='"+schoolType+"']").text());
        }

        var is211 = "${params.is211}";
        if(is211=="1"){
            $("#tablist_b").find("ul").find("li[rel='211']").addClass("cur");
        }
        var is985 = "${params.is985}";
        if(is985=="1"){
            $("#tablist_b").find("ul").find("li[rel='985']").addClass("cur");
        }
    });
</script>
</body>
</html>